home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 367 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: hubcap.clemson.edu!hubcap!mjs
  2. From: mjs@hubcap.clemson.edu (M. J. Saltzman)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: RANDOM NUMBER GENERATOR
  5. Date: 3 Jan 96 23:44:35 GMT
  6. Organization: Clemson University
  7. Message-ID: <mjs.820712675@hubcap>
  8. References: <ABg4lwmmK4@lh.ioffe.rssi.ru> <4cf1d2$1ts@oldfart.ecl.wustl.edu>
  9. NNTP-Posting-Host: hubcap.clemson.edu
  10.  
  11. "Klaus L. Nordstrom" <kln@news.hpn.org> writes:
  12.  
  13. >"Eugene I Levin" <Levin@lh.ioffe.rssi.ru> wrote:
  14. >>
  15. >>Tom, you are RIGHT! The congruent generator which is employed in
  16. >>rand() is the bad one! And everybody know that.
  17.  
  18. This should read "commonly employed in rand().  The implementor is
  19. under no obligation to use that same old random number generator,
  20. and indeed many implementations don't.  It would be nice if more 
  21. implementors paid more careful attention to this issue, though.
  22.  
  23. >If one uses <stdlib.h>, does one not automatically get access to
  24. >srand48() and drand48()? These routines generates good quality random
  25. >numbers with long periodicities.
  26.  
  27. One does not in ANSI/ISO Standard C, although many Unix implementations 
  28. provide them as an extension.
  29.  
  30. >Also, you may wish to check "numerical Recipies in C", authored by
  31. >Teukolsky and Press.
  32.  
  33. >-kln.
  34.  
  35. -- 
  36.         Matthew Saltzman
  37.         Clemson University Math Sciences
  38.         mjs@clemson.edu
  39.